Font TAG with style IN HTML

The <font> tag in HTML was traditionally employed to customize text appearance, including font type, size, and color. Despite its former popularity, it's now deprecated in HTML5 in favor of CSS for styling. This tag featured attributes like 'face', 'size', and 'color' to define text characteristics directly within the tag. Contemporary web development emphasizes using CSS for text styling, enhancing code clarity and maintainability.

  • Example:
  • Example-1

    <!DOCTYPE html> <html> <head> <title></title> </head> <body> <font face="Arial" size="4" color="tomato">PBA INSTITUTE</font> </body> </html>

    Output :

    PBA INSTITUTE

    In this example:

    face :attribute specifies the font face.

    size :attribute specifies the font size.

    color :attribute specifies the font color.

    Example-2

    <!DOCTYPE html> <html> <head> <title></title> </head> <body> <font face="Helvetica"Size="1">It is a Black size 8pt</font><br> <font face="helvetica"Size="2">It is a Helvetica-Black size 10pt</font> </body> </html>

    Output :

    It is a Black size 8pt
    It is a Helvetica-Black size 10pt

    Example-3

    <!DOCTYPE html> <html> <body> <font face="kabelbkbt"size="3">It is a kabel bk bt size 12pt</font><br> <font face="courier"size="4">It is a courier size 14pt</font><br> <font face="impact"size="5">It is a impact size 18pt</font><br> </body> </html>

    Output :

    It is a kabel bk bt size 12pt
    It is a courier size 14pt
    It is a impact size 18pt

  • Conclusion :
  • In conclusion, while the <font> tag with inline styling was once common for quick text formatting, it's now considered outdated and discouraged. Modern web design emphasizes separation of content and presentation for better maintainability and accessibility. Utilizing CSS for font styling offers greater control, flexibility, and compatibility across different devices and browsers. Embracing CSS ensures a more efficient and future-proof approach to web development, enhancing both user experience and code management.